package xyz.zhzby.cyzx.oj.messenger;

import io.swagger.annotations.ApiModel;
import lombok.Getter;
import org.springframework.context.ApplicationEvent;

import java.util.Date;

/**
 * @author zby
 * @date 2022/02/05
 */
@Getter
@ApiModel("评测机心跳事件消息")
public class KeepAliveEvent extends ApplicationEvent {

    private static final long serialVersionUID = -9218788192064705664L;

    private final String judgerUsername;

    private final String judgerDescription;

    private final Date heartbeatTime;

    /**
     * @Param [source, judgerUsername, judgerDescription, heartbeatTime] [消息发布源, 评测机的用户名, 评测机的描述信息]
     * @Return []
     * @Author zby
     * @Date 2022/02/05
     * @Description KeepAliveEvent的构造函数.
     */
    public KeepAliveEvent(Object source, String judgerUsername, String judgerDescription, Date heartbeatTime) {
        super(source);
        this.judgerUsername = judgerUsername;
        this.judgerDescription = judgerDescription;
        this.heartbeatTime = heartbeatTime;
    }

}
